#pragma once

#include <windows.h>
#include <istream>
#include <fstream>
#include <map>
#include <string>

#include <FileHolder.h>

#include "IResources.h"
#include "IAutoLoadResources.h"
#include "MaterialsCollection.h"
#include "TexturesManager.h"
//#include "ResourcesManager.h"
#include "MaterialLoader.h"

class MaterialManager : public IResources<MaterialsCollection*>, public IAutoLoadResources
{
private:
	std::map<std::string, MaterialsCollection*> materials;
	TexturesManager *texMan;

	Shader *vpBasicLight;
	Shader *fpBasicLight;

public:
	MaterialManager(TexturesManager *texMan, Shader *vpBasicLight, Shader *fpBasicLight);
	~MaterialManager(void);

	void Load(const char *path, const char *ext);
	void Add(const char *name, MaterialsCollection* res);
	MaterialsCollection * Get(const char *name);

	int GetCount();
	void Get(int i, char *name, MaterialsCollection *&res);
};
